oracle.pgx.api

## Class PgxPath<ID extends Comparable<ID>>

- java.lang.Object
- - oracle.pgx.api.Destroyable
  - - oracle.pgx.api.PgxPath<ID>

- Type Parameters:
    `ID` - the vertex ID type
  All Implemented Interfaces:
    AutoCloseable

      public class PgxPath<ID extends Comparable<ID>>
      extends Destroyable

  A path from a source to a destination vertex in a `PgxGraph`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `PgxPath.PathIterable<E>`
    `static class` | `PgxPath.PathIterator<E>` A read-only `ListIterator` with an additional `PgxPath.PathIterator.reset()` method to start over iteration.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `boolean` | `exists()` Checks whether a path exists.
    `PgxVertex<ID>` | `getDestination()` Gets the destination vertex.
    `PgxPath.PathIterable<PgxEdge>` | `getEdges()` Gets the edges of this path.
    `PgxGraph` | `getGraph()` Gets the PgxGraph the Path is defined on.
    `double` | `getPathLengthWithCost()` Gets the path cost Note: for hop-based algorithms, this method returns `getPathLengthWithHop()` as double.
    `long` | `getPathLengthWithHop()` Gets the path length in hops.
    `PgxVertex<ID>` | `getSource()` Gets the source vertex.
    `PgxPath.PathIterable<PgxVertex<ID>>` | `getVertices()` Gets the vertices of this path.
    `String` | `toString()`

    - ### Methods inherited from class oracle.pgx.api.Destroyable

      `close, destroy, destroyAsync`

    - ### Methods inherited from class java.lang.Object

      `getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### exists

          public boolean exists()

      Checks whether a path exists.
      Returns:
        true, if exists

    - #### getDestination

          public PgxVertex<ID> getDestination()

      Gets the destination vertex.
      Returns:
        destination vertex

    - #### getEdges

          public PgxPath.PathIterable<PgxEdge> getEdges()

      Gets the edges of this path.
      Returns:
        edges iterable

    - #### getGraph

          public PgxGraph getGraph()

      Gets the PgxGraph the Path is defined on.
      Returns:
        the graph

    - #### getPathLengthWithCost

          public double getPathLengthWithCost()

      Gets the path cost Note: for hop-based algorithms, this method returns `getPathLengthWithHop()` as double.
      Returns:
        total cost of this path (zero if path doesn't exist). The returned value equals the sum of the edge costs

    - #### getPathLengthWithHop

          public long getPathLengthWithHop()

      Gets the path length in hops.
      Returns:
        number of edges in this path (zero if path doesn't exist)

    - #### getSource

          public PgxVertex<ID> getSource()

      Gets the source vertex.
      Returns:
        source vertex

    - #### getVertices

          public PgxPath.PathIterable<PgxVertex<ID>> getVertices()

      Gets the vertices of this path.
      Returns:
        vertices iterable

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2015. All rights reserved.